// Copyright (C) 1953-2022 NUDT
// Verilog module name - initiator_timestamps_record 
// Version: V4.1.0.20221207
// Created:
//         by - fenglin 
////////////////////////////////////////////////////////////////////////////
// Description:
//         
///////////////////////////////////////////////////////////////////////////

`timescale 1ns / 1ps

module initiator_timestamps_record 
(
        i_clk                  ,
        i_rst_n                ,
			
        iv_mea_clk         	   ,
		
		i_osm_req_tx_pulse_p0  ,
		i_osm_resp_rx_pulse_p0 ,
		i_osm_req_tx_pulse_p1  ,
		i_osm_resp_rx_pulse_p1 ,
		i_osm_req_tx_pulse_p2  ,
		i_osm_resp_rx_pulse_p2 ,
		i_osm_req_tx_pulse_p3  ,
		i_osm_resp_rx_pulse_p3 ,
		i_osm_req_tx_pulse_p4  ,
		i_osm_resp_rx_pulse_p4 ,
		i_osm_req_tx_pulse_p5  ,
		i_osm_resp_rx_pulse_p5 ,
		i_osm_req_tx_pulse_p6  ,
		i_osm_resp_rx_pulse_p6 ,
		i_osm_req_tx_pulse_p7  ,
		i_osm_resp_rx_pulse_p7 ,
		i_osm_req_tx_pulse_p8  ,
		i_osm_resp_rx_pulse_p8 ,
		i_osm_req_tx_pulse_p9  ,
		i_osm_resp_rx_pulse_p9 ,
		i_osm_req_tx_pulse_p10  ,
		i_osm_resp_rx_pulse_p10 ,
		i_osm_req_tx_pulse_p11  ,
		i_osm_resp_rx_pulse_p11 ,
		i_osm_req_tx_pulse_p12  ,
		i_osm_resp_rx_pulse_p12 ,
		i_osm_req_tx_pulse_p13  ,
		i_osm_resp_rx_pulse_p13 ,
		i_osm_req_tx_pulse_p14  ,
		i_osm_resp_rx_pulse_p14 ,
		i_osm_req_tx_pulse_p15  ,
		i_osm_resp_rx_pulse_p15 ,
		i_osm_req_tx_pulse_p16  ,
		i_osm_resp_rx_pulse_p16 ,
		i_osm_req_tx_pulse_p17  ,
		i_osm_resp_rx_pulse_p17 ,
		i_osm_req_tx_pulse_p18  ,
		i_osm_resp_rx_pulse_p18 ,
		i_osm_req_tx_pulse_p19  ,
		i_osm_resp_rx_pulse_p19 ,
		i_osm_req_tx_pulse_p20  ,
		i_osm_resp_rx_pulse_p20 ,
		i_osm_req_tx_pulse_p21  ,
		i_osm_resp_rx_pulse_p21 ,
		i_osm_req_tx_pulse_p22  ,
		i_osm_resp_rx_pulse_p22 ,
		i_osm_req_tx_pulse_p23  ,
		i_osm_resp_rx_pulse_p23 ,
		i_osm_req_tx_pulse_p24  ,
		i_osm_resp_rx_pulse_p24 ,	
		i_osm_req_tx_pulse_p25  ,
		i_osm_resp_rx_pulse_p25 ,
		i_osm_req_tx_pulse_p26  ,
		i_osm_resp_rx_pulse_p26 ,
		i_osm_req_tx_pulse_p27  ,
		i_osm_resp_rx_pulse_p27 ,
		i_osm_req_tx_pulse_p28  ,
		i_osm_resp_rx_pulse_p28 ,
		i_osm_req_tx_pulse_p29  ,
		i_osm_resp_rx_pulse_p29 ,
		i_osm_req_tx_pulse_p30  ,
		i_osm_resp_rx_pulse_p30 ,
		i_osm_req_tx_pulse_p31  ,
		i_osm_resp_rx_pulse_p31 ,		

        ov_t1                  ,	
        ov_t4                  ,	
        ov_port_id             ,			
        o_t1_valid             ,
		o_t4_valid
);
// clk & rst
input                  i_clk;
input                  i_rst_n;

input      [79:0]      iv_mea_clk;

input                  i_osm_req_tx_pulse_p0   ;
input                  i_osm_resp_rx_pulse_p0  ;
input                  i_osm_req_tx_pulse_p1   ;
input                  i_osm_resp_rx_pulse_p1  ;
input                  i_osm_req_tx_pulse_p2   ;
input                  i_osm_resp_rx_pulse_p2  ;
input                  i_osm_req_tx_pulse_p3   ;
input                  i_osm_resp_rx_pulse_p3  ;
input                  i_osm_req_tx_pulse_p4   ;
input                  i_osm_resp_rx_pulse_p4  ;
input                  i_osm_req_tx_pulse_p5   ;
input                  i_osm_resp_rx_pulse_p5  ;
input                  i_osm_req_tx_pulse_p6   ;
input                  i_osm_resp_rx_pulse_p6  ;
input                  i_osm_req_tx_pulse_p7   ;
input                  i_osm_resp_rx_pulse_p7  ;
input                  i_osm_req_tx_pulse_p8   ;
input                  i_osm_resp_rx_pulse_p8  ;
input                  i_osm_req_tx_pulse_p9   ;
input                  i_osm_resp_rx_pulse_p9  ;
input                  i_osm_req_tx_pulse_p10  ;
input                  i_osm_resp_rx_pulse_p10 ;
input                  i_osm_req_tx_pulse_p11  ;
input                  i_osm_resp_rx_pulse_p11 ;
input                  i_osm_req_tx_pulse_p12  ;
input                  i_osm_resp_rx_pulse_p12 ;
input                  i_osm_req_tx_pulse_p13  ;
input                  i_osm_resp_rx_pulse_p13 ;
input                  i_osm_req_tx_pulse_p14  ;
input                  i_osm_resp_rx_pulse_p14 ;
input                  i_osm_req_tx_pulse_p15  ;
input                  i_osm_resp_rx_pulse_p15 ;
input                  i_osm_req_tx_pulse_p16  ;
input                  i_osm_resp_rx_pulse_p16 ;
input                  i_osm_req_tx_pulse_p17  ;
input                  i_osm_resp_rx_pulse_p17 ;
input                  i_osm_req_tx_pulse_p18  ;
input                  i_osm_resp_rx_pulse_p18 ;
input                  i_osm_req_tx_pulse_p19  ;
input                  i_osm_resp_rx_pulse_p19 ;
input                  i_osm_req_tx_pulse_p20  ;
input                  i_osm_resp_rx_pulse_p20 ;
input                  i_osm_req_tx_pulse_p21  ;
input                  i_osm_resp_rx_pulse_p21 ;
input                  i_osm_req_tx_pulse_p22  ;
input                  i_osm_resp_rx_pulse_p22 ;
input                  i_osm_req_tx_pulse_p23  ;
input                  i_osm_resp_rx_pulse_p23 ;
input                  i_osm_req_tx_pulse_p24  ;
input                  i_osm_resp_rx_pulse_p24 ;
input                  i_osm_req_tx_pulse_p25  ;
input                  i_osm_resp_rx_pulse_p25 ;
input                  i_osm_req_tx_pulse_p26  ;
input                  i_osm_resp_rx_pulse_p26 ;
input                  i_osm_req_tx_pulse_p27  ;
input                  i_osm_resp_rx_pulse_p27 ;
input                  i_osm_req_tx_pulse_p28  ;
input                  i_osm_resp_rx_pulse_p28 ;
input                  i_osm_req_tx_pulse_p29  ;
input                  i_osm_resp_rx_pulse_p29 ;
input                  i_osm_req_tx_pulse_p30  ;
input                  i_osm_resp_rx_pulse_p30 ;
input                  i_osm_req_tx_pulse_p31  ;
input                  i_osm_resp_rx_pulse_p31 ;

output reg  [79:0]     ov_t1                   ;	
output reg  [79:0]     ov_t4                   ;
output reg  [4:0]      ov_port_id              ;	
output reg             o_t1_valid              ;
output reg             o_t4_valid              ;		  
//////////////////cycle count///////////////// 
always @(posedge i_clk or negedge i_rst_n) begin
    if(!i_rst_n)begin
	    ov_t1               <= 80'b0;
		ov_t4               <= 80'b0;
		ov_port_id          <= 5'b0 ;
		o_t1_valid          <= 1'b0 ;
		o_t4_valid          <= 1'b0 ;
    end
    else begin
        if(i_osm_req_tx_pulse_p0)begin
		    ov_port_id          <= 5'b0  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p0)begin
		    ov_port_id          <= 5'b0  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		
        else if(i_osm_req_tx_pulse_p1)begin
		    ov_port_id          <= 5'd1  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p1)begin
		    ov_port_id          <= 5'd1  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p2)begin
		    ov_port_id          <= 5'd2  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p2)begin
		    ov_port_id          <= 5'd2  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end

        else if(i_osm_req_tx_pulse_p3)begin
		    ov_port_id          <= 5'd3  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p3)begin
		    ov_port_id          <= 5'd3  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p4)begin
		    ov_port_id          <= 5'd4  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p4)begin
		    ov_port_id          <= 5'd4  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p5)begin
		    ov_port_id          <= 5'd5  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p5)begin
		    ov_port_id          <= 5'd5  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p6)begin
		    ov_port_id          <= 5'd6  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p6)begin
		    ov_port_id          <= 5'd6  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p7)begin
		    ov_port_id          <= 5'd7  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p7)begin
		    ov_port_id          <= 5'd7  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p8)begin
		    ov_port_id          <= 5'd8  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p8)begin
		    ov_port_id          <= 5'd8  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p9)begin
		    ov_port_id          <= 5'd9  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p9)begin
		    ov_port_id          <= 5'd9  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end		

        else if(i_osm_req_tx_pulse_p10)begin
		    ov_port_id          <= 5'd10  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p10)begin
		    ov_port_id          <= 5'd10  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end

        else if(i_osm_req_tx_pulse_p11)begin
		    ov_port_id          <= 5'd11  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p11)begin
		    ov_port_id          <= 5'd11  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p12)begin
		    ov_port_id          <= 5'd12  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p12)begin
		    ov_port_id          <= 5'd12  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end

        else if(i_osm_req_tx_pulse_p13)begin
		    ov_port_id          <= 5'd13  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p13)begin
		    ov_port_id          <= 5'd13  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		
        else if(i_osm_req_tx_pulse_p14)begin
		    ov_port_id          <= 5'd14  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p14)begin
		    ov_port_id          <= 5'd14  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end		

        else if(i_osm_req_tx_pulse_p15)begin
		    ov_port_id          <= 5'd15  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p15)begin
		    ov_port_id          <= 5'd15  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		
        else if(i_osm_req_tx_pulse_p16)begin
		    ov_port_id          <= 5'd16  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p16)begin
		    ov_port_id          <= 5'd16  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p17)begin
		    ov_port_id          <= 5'd17  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p17)begin
		    ov_port_id          <= 5'd17  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end		
		
        else if(i_osm_req_tx_pulse_p18)begin
		    ov_port_id          <= 5'd18  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p18)begin
		    ov_port_id          <= 5'd18  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p19)begin
		    ov_port_id          <= 5'd19  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p19)begin
		    ov_port_id          <= 5'd19  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p20)begin
		    ov_port_id          <= 5'd20  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p20)begin
		    ov_port_id          <= 5'd20  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p21)begin
		    ov_port_id          <= 5'd21  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p21)begin
		    ov_port_id          <= 5'd21  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end

        else if(i_osm_req_tx_pulse_p22)begin
		    ov_port_id          <= 5'd22  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p22)begin
		    ov_port_id          <= 5'd22  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end		

        else if(i_osm_req_tx_pulse_p23)begin
		    ov_port_id          <= 5'd23  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p23)begin
		    ov_port_id          <= 5'd23  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end		

        else if(i_osm_req_tx_pulse_p24)begin
		    ov_port_id          <= 5'd24  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p24)begin
		    ov_port_id          <= 5'd24  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end			
		
        else if(i_osm_req_tx_pulse_p25)begin
		    ov_port_id          <= 5'd25  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p25)begin
		    ov_port_id          <= 5'd25  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end		

        else if(i_osm_req_tx_pulse_p26)begin
		    ov_port_id          <= 5'd26  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p26)begin
		    ov_port_id          <= 5'd26  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end		

        else if(i_osm_req_tx_pulse_p27)begin
		    ov_port_id          <= 5'd27  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p27)begin
		    ov_port_id          <= 5'd27  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end		

        else if(i_osm_req_tx_pulse_p28)begin
		    ov_port_id          <= 5'd28  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p28)begin
		    ov_port_id          <= 5'd28  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end			
		
        else if(i_osm_req_tx_pulse_p29)begin
		    ov_port_id          <= 5'd29  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p29)begin
		    ov_port_id          <= 5'd29  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end	

        else if(i_osm_req_tx_pulse_p30)begin
		    ov_port_id          <= 5'd30  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p30)begin
		    ov_port_id          <= 5'd30  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end		

        else if(i_osm_req_tx_pulse_p31)begin
		    ov_port_id          <= 5'd31  ;
			o_t1_valid          <= 1'b1  ;
			o_t4_valid          <= 1'b0  ;
			ov_t4               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32];
				ov_t1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else if(i_osm_resp_rx_pulse_p31)begin
		    ov_port_id          <= 5'd31  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b1  ;
			ov_t1               <= 80'b0;
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32];
				ov_t4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end			
		
		else begin
		    ov_port_id          <= 5'd0  ;
			o_t1_valid          <= 1'b0  ;
			o_t4_valid          <= 1'b0  ;
			ov_t1               <= 80'b0 ;
			ov_t4               <= 80'b0 ;
		end
    end
end

endmodule